// 封装所有和用户相关的接口函数
import request from '@/utils/http'

export const loginAPI = ({ username, password }) => {
  return request({
    url: '/login',
    method: 'POST',
    data: {
      username,
      password
    }
  })
}
export const getLikeListAPI = ({ limit = 4 }) => {
  return request({
    url: '/goods/relevant',
    params: {
      limit
    }
  })
}

export const sendVerifyCodeAPI = (params) => {
  return request({
    url: '/send',
    method: 'GET',
    params
  })

}

export const uploadIdcardImage = (file) => {
  const formData = new FormData();
  formData.append('file', file);

  return request({
    url: '/uploadImage', // 请根据实际情况替换成你的后端接口地址
    method: 'POST',
    data: formData,
  });
};

export const registerAPI = (data) => {
  return request({
    url: '/registerAll',
    method: 'POST',
    data,
    // headers: {
    //   'Content-Type': 'application/json',
    // },
  });
};

